package com.geeguang.utils;

import com.jfinal.kit.Prop;
import com.jfinal.kit.PropKit;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * Created by Administrator on 2017-10-14.
 */
public class DbUtils {
    private static String url=null;
    private static String user=null;
    private static String password=null;
    private static String driver="com.mysql.jdbc.Driver";
    static{
        Prop prop=PropKit.use("javen_config.txt");
        url=prop.get("jdbcUrl");
        user=prop.get("user");
        password=prop.get("password");
    }
    public  Connection getCon(){

        try {
            Class.forName(driver);
            return  DriverManager.getConnection(url,user,password);
        }catch (Exception  e){
            e.printStackTrace();
        }
        return null;
    }
}
